Image processing device, foreign object inspection device, image processing method, and foreign object inspection method

ABSTRACT

An image processing device capable of high-accuracy foreign object inspection is provided. The image processing device include a background value setting section configured to (i) obtain a value for use as a background value on a basis of a first pixel value of at least one reference pixel present in the vicinity of a target pixel and having a predetermined positional relationship with the target pixel, and (ii) set the background value of the target pixel to the value obtained.

This Nonprovisional application claims priority under 35 U.S.C. § 119 onPatent Application No. 2018-065909 filed in Japan on Mar. 29, 2018, theentire contents of which are hereby incorporated by reference.

TECHNICAL FIELD

The present invention relates to an image processing device, a foreignobject inspection device, an image processing method, and a foreignobject inspection method.

BACKGROUND ART

Nonaqueous electrolyte secondary batteries such as lithium-ion secondarybatteries are in wide use as batteries for personal computers, mobiletelephones, portable information terminals, and the like. Lithium-ionsecondary batteries, in particular, are drawing attention as batteriesthat help reduce CO₂ emissions and that contribute to energy saving, ascompared to conventional secondary batteries.

Separator rolls have been under development, the separator rolls eachincluding a core and a nonaqueous electrolyte secondary batteryseparator wound around the core. In addition, foreign object inspectionhas been researched for detecting foreign objects adhering to aseparator roll.

An example technique applicable to the foreign object inspection isdisclosed in Patent Literature 1. The technique disclosed in PatentLiterature 1 includes (i) integrating the respective density levels ofindividual pixels on the basis of data on an image of an inspectiontarget and (ii) comparing the integrated value with a predeterminedthreshold value to detect any defect. The threshold value used for thetechnique of Patent Literature 1 may be updated as appropriate accordingto image data.

CITATION LIST Patent Literature

[Patent Literature 1]

Japanese Patent Application Publication, Tokukai, No. 2005-265467(Publication date: Sep. 29, 2005)

SUMMARY OF INVENTION Technical Problem

Brightness may vary across an image according to the position on theinspection target due to distribution of electromagnetic wavetransmittance of the inspection target. An image of a label attached toan inspection target, for example, tends to be significantly darker thanan image of the inspection target itself. Brightness may also varyaccording to the presence or absence of a shadow caused by anelectromagnetic wave and the inspection target and to where the shadowis projected.

This brightness variation is not discussed in Patent Literature 1. Thetechnique may unfortunately set an inappropriate threshold value as aresult of referring to a significantly darker portion of an image of aninspection target. The technique consequently involves an issue of apotentially decreased accuracy in foreign object inspection.

An aspect of the present invention has an object of providing an imageprocessing device, a foreign object inspection device, an imageprocessing method, and a foreign object inspection method each of whichallows high-accuracy foreign object inspection.

Solution to Problem

In order to attain the above object, an image processing device inaccordance with an embodiment of the present invention is an imageprocessing device for processing an image captured of (i) an inspectiontarget as a background in an inspection image and (ii) a foreign objecthaving contrast to the background, the image processing deviceincluding: a storage section configured to store respective first pixelvalues of a plurality of pixels that form the image; a pixel valuecomputing section configured to select each of the plurality of pixelsas a target pixel and calculate a second pixel value of the targetpixel, the second pixel value being (i) a difference between a firstpixel value of the target pixel and a background value of the targetpixel or (ii) a ratio of the difference to the background value; and abackground value setting section configured to, for each target pixel,(i) obtain a value for use as the background value on a basis of a firstpixel value of at least one reference pixel present in a vicinity of thetarget pixel and having a predetermined positional relationship with thetarget pixel and (ii) set the background value of the target pixel tothe value obtained.

In order to attain the above object, an image processing method inaccordance with an embodiment of the present invention is an imageprocessing method for processing an image captured of (i) an inspectiontarget as a background in an inspection image and (ii) a foreign objecthaving contrast to the background, the image processing methodincluding: a storage step of storing respective first pixel values of aplurality of pixels that form the image; a pixel value computing step ofselecting each of the plurality of pixels as a target pixel andcalculating a second pixel value of the target pixel, the second pixelvalue being (i) a difference between a first pixel value of the targetpixel and a background value of the target pixel or (ii) a ratio of thedifference to the background value; and a background value setting stepof, for each target pixel, (i) obtaining a value for use as thebackground value on a basis of a first pixel value of at least onereference pixel present in a vicinity of the target pixel and having apredetermined positional relationship with the target pixel and (ii)setting the background value of the target pixel to the value obtained.

Advantageous Effects of Invention

An aspect of the present invention allows high-accuracy foreign objectinspection.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a diagram schematically illustrating the configuration of aforeign object inspection device in accordance with an aspect of thepresent invention.

FIG. 2 is a plan view of a principal surface of an image sensor.

FIG. 3 is a plan view of the principal surface, illustrating an exampleof how a plurality of reference pixels are set.

FIG. 4 is a flowchart illustrating a flow of how the image processingdevice processes an image.

FIG. 5 shows the respective first pixel values that the storage sectionstores of the plurality of pixels in FIG. 2.

FIG. 6 shows the respective second pixel values that the pixel valuecomputing section has calculated of the plurality of pixels in FIG. 2 onthe basis of the first pixel values in FIG. 5 and a background value setfor each pixel.

FIG. 7 shows the respective integrated values that the pixel valueintegrating section has produced of the plurality of pixels in FIG. 2 onthe basis of the second pixel values in FIG. 6.

FIG. 8 is a perspective diagram illustrating a quadrangular pyramidformed with (i) the center of that portion of the electromagnetic wavegenerating source at which an electromagnetic wave is generated and (ii)the four corners of a pixel.

FIG. 9 is a diagram schematically illustrating the configuration of afirst variation of the foreign object inspection device illustrated inFIG. 1.

FIG. 10 is a diagram schematically illustrating the configuration of asecond variation of the foreign object inspection device illustrated inFIG. 1.

FIG. 11 is a diagram illustrating how a rotating mechanism rotates aninspection target.

FIG. 12 is a table that shows the results of verifying the effectivenessof the pixel value integrating section of a foreign object inspectiondevice that uses an X ray as an electromagnetic wave.

DESCRIPTION OF EMBODIMENTS

FIG. 1 is a diagram schematically illustrating the configuration of aforeign object inspection device 100 in accordance with an aspect of thepresent invention. FIG. 2 is a plan view of a principal surface 31 of animage sensor 3.

The foreign object inspection device 100 is configured to detect aforeign object 13 adhering to an inspection target 1. The inspectiontarget 1 is a separator roll including a core 11 and a nonaqueouselectrolyte secondary battery separator 12 wound around the core 11. Theinspection target 1 may alternatively be a roll including a core 11 anda film wound around the core 11 which film is other than a nonaqueouselectrolyte secondary battery separator 12, or be something other than aroll including a core 11 and a film wound around the core 11. Theforeign object inspection device 100 includes an electromagnetic wavegenerating source 2, an image sensor 3, and an image processing device4.

The electromagnetic wave generating source 2 emits an electromagneticwave 21 to a side surface of the inspection target 1. Theelectromagnetic wave 21 propagates through the inspection target 1 andthe foreign object 13, and exits the inspection target 1 from the otherside surface. The two side surfaces of the inspection target 1 are therespective surfaces at the opposite widthwise ends of the nonaqueouselectrolyte secondary battery separator 12. The width direction of thenonaqueous electrolyte secondary battery separator 12 refers to thatdirection along the surface of the nonaqueous electrolyte secondarybattery separator 12 which is perpendicular to the direction in which anunfinished nonaqueous electrolyte secondary battery separator 12 isconveyed during the process of producing the nonaqueous electrolytesecondary battery separator 12. The electromagnetic wave 21 for thepresent embodiment is an X ray that the electromagnetic wave generatingsource 2 emits radially.

The image sensor 3 has a principal surface 31. The image sensor 3includes, on the principal surface 31, a plurality of pixels 32configured to (i) receive an electromagnetic wave 21 having propagatedthrough the inspection target 1 and the foreign object 13 and thereby(ii) form an image on the basis of the electromagnetic wave 21. Forconvenience of illustration, FIG. 2 shows, among the plurality of pixels32, only 225 pixels 32 arranged in a 15×15 matrix. The image sensor 3for the present embodiment is an X-ray image sensor.

An image formed by the plurality of pixels 32 can be described as beingan image captured of (i) an inspection target 1 as the background in aninspection image and (ii) a foreign object 13 having contrast to thebackground.

The present embodiment assumes that the foreign object 13 is a substance(for example, a metal foreign object) that attenuates a propagating Xray more than the inspection target 1 does. In this case, an imageformed by the plurality of pixels 32 can be described as being an imageformed on the basis of an electromagnetic wave 21 that has propagatedthrough an inspection target 1 with a foreign object 13 adhering theretoand that has been attenuated more by the foreign object 13 than by theinspection target 1.

The foreign object 13 may alternatively be something (for example, adefective hollow [air bubble] in an inspection target 1) that attenuatesa propagating X ray less than the inspection target 1 does. In thiscase, an image formed by the plurality of pixels 32 can be described asbeing an image formed on the basis of an electromagnetic wave 21 thathas propagated through an inspection target 1 with a foreign object 13adhering thereto and that has been attenuated less by the foreign object13 than by the inspection target 1.

In either case, an image formed by the plurality of pixels 32 is animage captured of (i) an inspection target 1 as the background in aninspection image and (ii) a foreign object 13 having contrast to thebackground.

The image processing device 4 is configured to process an image formedby the plurality of pixels 32. The image processing device 4 includes astorage section 41, a pixel value computing section 42, a backgroundvalue setting section 43, and a pixel value integrating section 44.

The storage section 41 includes, for example, a well-known storagemedium. The storage section 41 stores the respective pixel values of theplurality of pixels 32, which form an image that the image processingdevice 4 processes. The description below uses the term “first pixelvalues” to refer to those pixel values which the storage section 41stores. The specification of the present application assumes that thefirst pixel values and a later-described background value are larger ina case where the corresponding image is brighter. The first pixel valuesand the background value may alternatively be smaller in the case wherethe corresponding image is brighter.

FIG. 3 is a plan view of the principal surface 31, illustrating anexample of how a plurality of reference pixels 34 are set. FIG. 3 showsshaded pixels 32 to indicate the plurality of reference pixels 34. Thereference pixels 34 are, as described later, pixels 32 necessary to seta background value for the corresponding target pixel 33.

The pixel value computing section 42 includes, for example, a centralprocessing unit (CPU) or a hardware logic. The description below dealswith the target pixel 33 in FIG. 3 as an example. The target pixel 33is, as described later, a pixel 32 for which a background value is setwith reference to a plurality of corresponding reference pixels 34. Thepixel value computing section 42 selects each of the plurality of pixels32 as a target pixel 33 and calculates a second pixel value of thetarget pixel 33 on the basis of the first pixel values stored in thestorage section 41. The pixel value computing section 42, stateddifferently, calculates the second pixel value of each pixel 32.

The second pixel value of a target pixel 33 or each pixel 32 is thevalue of the ratio of the difference between the corresponding firstpixel value and the background value to the background value. Thebackground value can be described as being a value equivalent to howmuch the electromagnetic wave 21 is attenuated by the inspection target1. The second pixel value of a target pixel 33 or each pixel 32 is, inother words, expressed as “(corresponding first pixel value−backgroundvalue)/background value”. The result of computing a second pixel valueis referred to also as “relative density”, as the computation involvesdetermining the ratio of the above difference to the background value.

The background value setting section 43 includes, for example, a CPU ora hardware logic. The background value setting section 43 obtains, foreach target pixel 33, a value for use as a background value on the basisof the respective first pixel values of reference pixels 34 present inthe vicinity of the target pixel 33 and each having a predeterminedpositional relationship with the target pixel 33. The background valuesetting section 43 then sets the background value for the target pixel33 to the value obtained. The expression “each target pixel 33” isequivalent to the expression “each pixel 32”.

The pixel value integrating section 44 is configured to integrate therespective second pixel values of a group of pixels belonging in aparticular continuous region.

FIG. 4 is a flowchart illustrating a flow of how the image processingdevice 4 processes an image.

First, when the plurality of pixels 32 have formed an image on the basisof an electromagnetic wave 21, the storage section 41 stores therespective first pixel values of the plurality of pixels 32. Thiscorresponds to step S1 in FIG. 4. FIG. 5 shows the respective firstpixel values that the storage section 41 stores of the plurality ofpixels 32 in FIG. 2. FIG. 5 illustrates an example in which among the225 pixels 32 mentioned above, (i) 25 (5×5) central pixels form an imageon the basis of that portion of an electromagnetic wave 21 which hasbeen attenuated by an inspection target 1 and a foreign object 13, and(ii) the other pixels 32 form an image on the basis of that portion ofthe electromagnetic wave 21 which has been attenuated by the inspectiontarget 1 only. The 25 central pixels 32 correspond to the pixel group37. FIG. 5 shows “A1” and “A2”, which are defined as follows:

A1: First pixel value corresponding to the amount of attenuation of anelectromagnetic wave 21 by an inspection target 1

A2: First pixel value corresponding to the amount of attenuation of anelectromagnetic wave 21 by an inspection target 1 and a foreign object13

Subsequently to step S1, the background value setting section 43 sets abackground value for each pixel 32. This corresponds to step S2 in FIG.4. The background value setting section 43 setting a background valueallows the foreign object inspection device 100 to produce the followingeffect:

With the above configuration, the background value setting section 43sets a background value on the basis of the respective first pixelvalues of reference pixels 34 present in the vicinity of the targetpixel 33. In a case where, for instance, radiographic inspectioninvolves detecting (i) an inspection target 1 having a somewhat varying,but relatively high transmittance and (ii) a foreign object 13 attachedto the inspection target 1 and having a relatively low transmittance,the above configuration allows a second pixel value to be calculatedwhich second pixel value is influenced less by the transmittancevariation. Referring to the second pixel value in detecting a foreignobject 13 allows high-accuracy foreign object inspection.

The above configuration, in other words, allows the distribution oftransmittance of an inspection target 1 to be canceled out. Forinstance, even in a case where an inspection target 1 has atransmittance that varies (or is distributed) according to the positionon the inspection target 1, and the variation cannot be represented withstraight contour lines, the contour lines each having a low curvatureallows a background value to be set mostly accurately (that is, withonly a slight error). This in turn allows the correct second pixel valueto be calculated.

For the present embodiment, the electromagnetic wave generating source 2causes electrons to strike a metal plate to generate an X ray. Since anelectron-struck portion of the metal plate becomes heated, the metalplate is configured to be shaken so that electrons strike differentportions of the metal plate. This configuration causes theelectromagnetic wave generating source 2 to generate not an X ray in theshape of a dot, but a planar X ray. Consequently, in a case where theelectromagnetic wave generating source 2 emits such an X ray as anelectromagnetic wave 21, each image captured on the basis of theelectromagnetic wave 21 may have a variation in its brightnessdistribution. Further, each image captured on the basis of theelectromagnetic wave 21 may have a variation in its brightnessdistribution due to noise caused to the image. Even in such cases, theabove configuration allows a second pixel value to be calculated whichsecond pixel value is influenced less by the above variations.

The foreign object inspection device 100 selects reference pixels 34while excluding any pixel 32 having an extremely large or extremelysmall first pixel value to prevent the background value from beingexcessively larger or excessively smaller than a desired value. Thisallows a second pixel value to be calculated which second pixel value isinfluenced less by the above variations.

The foreign object inspection device 100 selects at least one referencepixel 34, but preferably selects a plurality of reference pixels 34 asillustrated in FIG. 3. This preferable configuration allows a largernumber of first pixel values to be referred to in finding a value foruse as a background value, and thereby allows a background value to beset by any of a wider range of methods. The description below deals withsuch options.

The plurality of reference pixels 34 are preferably multiple pixels 32surrounding the corresponding target pixel 33 as illustrated in FIG. 3.

In a case where a reference pixel(s) 34 and another pixel(s) present inthe vicinity of the reference pixel(s) 34 are each an unsuitable pixel35 having a first pixel value that is not suited as a value for use insetting a background value, the above configuration can reduce theproportion of unsuitable pixels 35 among the plurality of referencepixels 34. This makes it possible to reduce the risk of the first pixelvalue of an unsuitable pixel 35 adversely affecting how a backgroundvalue is set.

Assuming that the hatched pixels 32 in FIG. 3 are unsuitable pixels 35,those unsuitable pixels 35 are present locally at an upper left portionof the drawing. With the above configuration, some reference pixels 34are unsuitable pixels 35, while many other reference pixels 34 are notunsuitable pixels 35. The above configuration can, as in this case,reduce the proportion of unsuitable pixels 35 among the plurality ofreference pixels 34.

Example unsuitable pixels 35 include pixels 32 that form an image on thebasis of an electromagnetic wave 21 having propagated through a tape orlabel 14 attached to an inspection target 1. Such pixels 32 tend to havefirst pixel values that are extremely smaller than those of pixels thatform a shadow-free image on the basis of an electromagnetic wave 21having propagated through an inspection target 1 only.

The plurality of reference pixels 34 are preferably multiple pixels 32present symmetrically in the row direction and the column directionrelative to the corresponding target pixel 33 as illustrated in FIG. 3.The row direction and the column direction correspond respectively to“ROW DIRECTION” and “COLUMN DIRECTION” in FIG. 3.

The plurality of reference pixels 34 shown in FIG. 3 can be described asbeing constituted of four pixel groups 36 arranged in fourfold symmetryrelative to the target pixel 33 as the center. As in this case, theplurality of reference pixels 34 are preferably constituted of multiplepixels 32 present in n-fold symmetry (where n is an integer of 2 orgreater) relative to the corresponding target pixel 33 as the center.

Regardless of the direction in which unsuitable pixels 35 are presentlocally relative to the target pixel 33, the above configuration canreduce the proportion of unsuitable pixels 35 among the plurality ofreference pixels 34. This makes it possible to reduce the risk of thefirst pixel value of an unsuitable pixel 35 adversely affecting how abackground value is set.

FIG. 3 illustrates a case where a plurality of unsuitable pixels 35 arepresent locally in an upper left direction from the target pixel 33.With the above configuration, some reference pixels 34 are unsuitablepixels 35, while many other reference pixels 34 are not unsuitablepixels 35. The above configuration can, as in this case, reduce theproportion of unsuitable pixels 35 among the plurality of referencepixels 34.

In a case where, for instance, there is a need to change the directionin which the foreign object inspection device 100 captures an image ofan inspection target 1, the portion at which a plurality of unsuitablepixels 35 are present locally will be changed accordingly. In a casewhere the orientation of an inspection target 1 unfortunately needs tobe changed as a result of it being difficult for the foreign objectinspection device 100 to sufficiently control the orientation of theinspection target 1, the portion at which a plurality of unsuitablepixels 35 are present locally will be changed as well. The foreignobject inspection device 100 is capable of reducing the proportion ofunsuitable pixels 35 among the plurality of reference pixels 34 bothbefore and after a change of the direction in which the foreign objectinspection device 100 captures an image of an inspection target 1. Theforeign object inspection device 100 can thus be described as having asmall dependence on the direction in which the foreign object inspectiondevice 100 captures an image of an inspection target 1.

FIG. 3 illustrates the plurality of reference pixels 34 as multiplepixels 32 that are arranged to be adjacent to one another in a cohesivegroup surrounding the target pixel 33. The arrangement of referencepixels 34 is, however, not limited to this. At least one reference pixel34 may be present apart from the other reference pixels 34. Thereference pixels 34 may, for instance, be scattered around. Thereference pixels 34 may alternatively be arranged to form a plurality ofblocks that are scattered around, the blocks each including referencepixels 34 adjacent to one another.

The background value setting section 43 sets the background value to (i)the median value among the respective first pixel values of theplurality of reference pixels 34 or (ii) a value ranked in apredetermined place among the respective first pixel values of theplurality of reference pixels 34 except for the maximum value and theminimum value. The median value refers to (i) supposing that the totalnumber of the respective first pixel values of the plurality ofreference pixels 34 is 2p (where p is a natural number), the average ofthe p-th largest first pixel value and the (p+1)-th largest first pixelvalue, and (ii) supposing that the total number is 2p+1, the (p+1)-thlargest first pixel value. The predetermined place among the respectivefirst pixel values of the plurality of reference pixels 34 except forthe maximum value and the minimum value preferably refers to a rank thatallows an appropriate background value to be calculated easily accordingto properties such as noise. A preferable value for the rank is usuallya value as much close as possible to half the total number. The rankmay, however, preferably be selected on the basis of, for example, themode depending on the shape and/or placement of the inspection target 1.This is a method including (i) drawing a histogram of the respectivebrightnesses of the plurality of reference pixels 34 and (ii) selectingthe predetermined place on the basis of how frequently each brightnessappears (for example, selecting a rank corresponding to the brightnessthat appears with the highest frequency).

The above configuration makes it easy to prevent the background valuesetting section 43 from setting the background value to an extremelylarge or extremely small value among the respective first pixel valuesof the plurality of reference pixels 34. The above configuration, inother words, makes it possible to prevent the background value fromindicating a background with an inappropriately extreme brightness orinappropriately extreme darkness. The above configuration also makes iteasy to prevent the background value from being much larger or muchsmaller than an appropriate background value due to the aboveinappropriateness. The above configuration thereby makes it possible toset a background value more suitable for an image captured.

In a case where, for instance, a reference pixel 34 forms an imageincluding noise, that reference pixel 34 can have an extremely large orextremely small first pixel value. The foreign object inspection device100 can be described as being capable of reducing the risk of thebackground value being set to a first pixel value changedunintentionally due to the noise.

The background value setting section 43 may be used to, for a foreignobject inspection involving causing an electromagnetic wave 21 to bereflected by an inspection target 1 and a foreign object 13, set thebackground value to a value equivalent to the amount of attenuation ofthe electromagnetic wave 21 by the inspection target 1.

Subsequently to step S2, the pixel value computing section 42 calculatesthe second pixel value of each pixel 32. This corresponds to step S3 inFIG. 4. FIG. 6 shows the respective second pixel values that the pixelvalue computing section 42 has calculated of the plurality of pixels 32in FIG. 2 on the basis of the first pixel values in FIG. 5 and abackground value set for each pixel 32. FIG. 6 shows “B1” and “B2”,which are defined as follows:

B1: B1=(A1−(background value of corresponding pixel 32)/(backgroundvalue of corresponding pixel 32))

B2: B2=(A2−(background value of corresponding pixel 32)/(backgroundvalue of corresponding pixel 32))

Ideally, A1 is equal to the background value of the corresponding pixel32, so that B1 is 0. Each second pixel value reflects the thickness ofthat portion of a foreign object 13 which corresponds to the pixel 32.

Subsequently to step S3, the pixel value integrating section 44integrates the respective second pixel values of a group of pixelsbelonging in a particular continuous region. This corresponds to step S4in FIG. 4.

FIG. 7 shows the respective integrated values that the pixel valueintegrating section 44 has produced of the plurality of pixels 32 inFIG. 2 on the basis of the second pixel values in FIG. 6. FIG. 7illustrates an example in which the pixel value integrating section 44selects each of a plurality of pixels 32 as a target pixel 33, selectsas a continuous region a total of nine pixels 32 arranged in a 3×3matrix with the target pixel 33 as the center, and integrates therespective second pixel values of the nine pixels 32, which forms apixel group 38 belonging in the continuous region. FIG. 7 shows “C1” to“C7”, which are defined as follows:

C1: C1=9*B1

C2: C2=8*B1+1*B2

C3: C3=7*B1+2*B2

C4: C4=6*B1+3*B2

C5: C5=5*B1+4*B2

C6: C6=3*B1+6*B2

C7: C7=9*B2

As described above, the electromagnetic wave generating source 2generates not an X ray in the shape of a dot, but a planar X ray.Consequently, in a case where the electromagnetic wave generating source2 emits such an X ray as an electromagnetic wave 21, an image based onthe electromagnetic wave 21 is blurred. Thus, the amount of attenuationto be reflected by a pixel 32 for that portion of an image whichcorresponds to a foreign object 13 is (i) unintentionally reflectedpartially by a pixel(s) 32 present in the vicinity of the above pixel 32and is (ii) decreased accordingly.

X rays are unlike visible light: It is difficult to reduce the spotdiameter of an X ray or convert an X ray into parallel light with use ofa lens. Thus, that portion of an X-ray image which corresponds to aforeign object 13 is easily blurred as compared to a case where visiblelight is used.

With the above configuration, the pixel value integrating section 44integrates the respective second pixel values of pixels in a groupbelonging in a particular continuous region. Setting the size of thecontinuous region to a size larger than the size of a foreign object 13as a detection target makes it possible to calculate the sum total ofthe amount of X-ray attenuation caused by the foreign object 13. Thisallows that portion of an image which corresponds to a foreign object 13to be detected, thereby reducing the risk of a failure to detect aforeign object 13. Further, the above configuration makes it possible toreduce the risk of a failure to detect a foreign object 13 even in acase where the image is blurred. This advantage makes it possible toshorten the exposure time period for image capturing as compared toconventional art. These effects can be produced even with aconfiguration in which the pixel value integrating section 44integrates, instead of second pixel values, the first pixel valuesstored in the storage section 41.

To sum up the above description, the above particular continuous regionis a region larger than a region that includes at least all pixels 32that form an image based on an electromagnetic wave 21 attenuated by aninspection target 1 and a foreign object 13.

The above particular continuous region is preferably a region largerthan a region that further includes all pixels 32 corresponding to ablur of that portion of an image which corresponds to a foreign object13. This more reliably allows that portion of an image which correspondsto a foreign object 13 to be detected.

The above particular continuous region may be adjusted as appropriate soas to include at least a pixel(s) corresponding to a blur of thatportion of an image which corresponds to a foreign object 13.

The integrated value of the respective second pixel values of multiplepixels 32 belonging in a particular continuous region corresponds to thevolume of that portion of a foreign object 13 which corresponds to thosemultiple pixels 32. This makes it possible to estimate the volume of aportion of a foreign object 13 or the entire foreign object 13, therebymaking it possible to determine the presence or absence of a foreignobject 13 having a particular volume or larger. The above configuration,in other words, makes it possible to estimate the three-dimensional sizeof a foreign object 13.

The description below deals in detail with how the amount of attenuationof an X ray as an electromagnetic wave 21 is related to the volume of aforeign object 13. The volume of a foreign object 13 is equivalent tothe three-dimensional size of the foreign object 13. The descriptionbelow assumes that a foreign object 13 has a minutely small size.Specifically, such a minutely small foreign object 13 is sized such thatthe foreign object 13 would be contained in a sphere having a diameterof, for example, not less than 0.05 mm and not more than 0.3 mm.

The transmittance T of an electromagnetic wave 21 can be determined byMathematical Expression (1) below. In Mathematical Expression (1), “a”represents the absorption coefficient of a substance through which theelectromagnetic wave 21 propagates, and “z” represents the total lengthover which the electromagnetic wave 21 propagates through the substance.In a case where an electromagnetic wave 21 enters the substance once,“z” represents the thickness of the substance in the direction in whichthe electromagnetic wave 21 propagates. An electromagnetic wave 21 mayenter the substance two or more times in a case where, for example, thesubstance is hollowed or curved.

[Math. 1]

T=e ^(−az)  (1)

The degree by which an image based on an electromagnetic wave 21 isdarkened due to the electromagnetic wave 21 propagating through aforeign object 13 can be represented by 1-T. This 1-T is referred to asblocking rate.

FIG. 8 is a perspective diagram illustrating a quadrangular pyramid 23formed with (i) the center 22 of that portion of the electromagneticwave generating source 2 at which an electromagnetic wave 21 isgenerated and (ii) the four corners of a pixel 32. MathematicalExpression (2) below shows calculation of integration of the blockingrate for a foreign object 13 in the quadrangular pyramid 23.

The result of computation based on Mathematical Expression (2) shows therate at which the intensity of the electromagnetic wave 21 for the pixel32 is attenuated by the foreign object 13. In Mathematical Expression(2), “x” corresponds to an x direction, and “y” corresponds to a ydirection, the x and y directions being both perpendicular to thethickness direction of the foreign object 13 and being perpendicular toeach other.

[Math. 2]

∫∫(1−e ^(−az))dxdy  (2)

In a case where a foreign object 13 has a minutely small size, thatcross section of the quadrangular pyramid 23 which is substantiallyparallel to the surface of a pixel 32 has a substantially constant areain the vicinity of the foreign object 13. This indicates that thequadrangular pyramid 23 can be approximated to a rectangularparallelepiped in the vicinity of a foreign object 13. In a case wheresubstantially equals 0, Mathematical Expression (3) below holds.

[Math. 3]

(1−e ^(−az))≈az  (3)

These indicate that the rate at which the intensity of anelectromagnetic wave 21 is attenuated for a pixel 32 due to a foreignobject 13 can be approximated to Mathematical Expression (4) below.

[Math. 4]

a∫∫zdxdy  (4)

The result of computation based on Mathematical Expression (4) isequivalent to the volume of a portion at which the rectangularparallelepiped and a foreign object 13 coincide with each other. Theabove description shows that there is a correlation between the amountof attenuation of an X ray as an electromagnetic wave 21 and the volumeof a foreign object 13. In other words, the present embodiment allows,for each of a plurality of pixels 32, the volume of a foreign object 13to be determined on the basis of the relative density described abovewhich foreign object 13 coincides with the rectangular parallelepipedfor the pixel 32.

The description below supplementally deals with the mechanism by whichthe relative densities (namely, B1 and B2 defined above) or itsintegrated values (C1 to C7 defined above) are converted into the volumeof a foreign object 13. Suppose that L represents a first pixel valuecorresponding to the amount of attenuation of an electromagnetic wave 21by an inspection target 1 (ideally, L equals the background value). L ismultiplied by T of a foreign object 13 to give LT, which indicates theactual first pixel value. L is a value that varies according to theposition within the electromagnetic wave 21. In other words, L is afunction of x and y (L(x,y)). Since the second pixel value isrepresented by (LT−L)/L=(T−1), the result of multiplying (T−1) by −1 andintegrating (1-T) with respect to x and y, that is, MathematicalExpression (2), approximately equals Mathematical Expression (4). Thevalue given by Mathematical Expression (2) is divided by the factor “a”of proportionality to find the volume of the foreign object 13. In acase where the integrated value of each difference between the firstpixel value and the background value is used, (T−1) is replaced withL(T−1). In this case, estimating the volume of a foreign object 13requires L to be a constant. Stated differently, an inspection target 1being free from a foreign object 13 can be estimated with use of theintegrated value of the differences.

The pixel value integrating section 44 selects each of a plurality ofpixels 32 as a target pixel 33, and integrates the respective secondpixel values of a group of pixels belonging in a particular continuousregion including the target pixel 33.

With the above configuration, setting a continuous region correspondingroughly to the volume of a foreign object 13 which volume is to be setas a detection lower limit value and using, as a threshold value, theintegrated value corresponding to the foreign object 13 allows selectivedetection of a foreign object 13 having a volume with a detection lowerlimit value or higher.

The pixel value integrating section 44 preferably integrates therespective second pixel values of multiple pixels 32 that (i) each havea second pixel value indicative of an attenuation amount larger than athreshold value and that (ii) form a continuous region. The thresholdvalue preferably clearly indicates, for each of a plurality of pixels 32and regardless of noise or blur caused to an image based on theelectromagnetic wave 21, that an electromagnetic wave 21 has beenattenuated by a foreign object 13.

Multiple pixels 32 that each have a second pixel value indicative of anattenuation amount larger than a threshold value and that form acontinuous region may be regarded as corresponding to a singleindividual foreign object 13. The present embodiment is thus capable ofestimating the volume of a single individual foreign object 13.

The pixel value integrating section 44 may assign weights to at leasttwo second pixel values as an integration target.

In a case where, for instance, a foreign object 13 is spherical, aportion of the foreign object 13 which portion is farther away from thecenter toward the surface coincides with an electromagnetic wave 21 by asmaller volume and is thus expected to cause the corresponding portionof the image of the foreign object 13 to be brighter. For the purpose ofmaximizing a value obtained in correspondence with a foreign object 13,the pixel value integrating section 44 can assign respective weights tothe second pixel values for integration so that, for instance, a secondpixel value corresponding to a position closer to the surface of theforeign object 13 contributes less to the integrated value.

The pixel value integrating section 44 can assign respective weights tothe second pixel values according to the assumed shape (for example, asphere or a polyhedron) of a foreign object 13 as a detection target asdescribed above and then calculate an integrated value to be capable ofmore reliably detecting that portion of an image which corresponds to aforeign object 13.

The foreign object inspection device 100 includes an image sensor 3(X-ray image sensor) and an image processing device 4. The storagesection 41 stores, as first pixel values, the pixel values of an imageobtained by the X-ray image sensor.

The electromagnetic wave 21 is not limited to an X ray. Examples of theelectromagnetic wave 21 other than an X ray include various well-knownelectromagnetic waves such as visible light and infrared light. Theimage sensor 3 may accordingly be an image sensor selected asappropriate which image sensor is suited for the kind of electromagneticwave 21. Specific examples of the image sensor 3 other than an X-rayimage sensor include a flat panel detector (FPD).

The second pixel values may, instead of the relative densities describedabove, each be a difference between the corresponding first pixel valueand the corresponding background value. To estimate the volume of aforeign object 13, however, the second pixel values are suitably therelative densities.

The foreign object inspection device 100 is configured such that theimage processing device 4 is external to the image sensor 3. The imageprocessing device 4 may, however, alternatively be provided inside theimage sensor 3.

FIG. 9 is a diagram schematically illustrating the configuration of aforeign object inspection device 101 as a first variation of the foreignobject inspection device 100 illustrated in FIG. 1. For convenience ofexplanation, any member below that is identical in function to a memberdescribed above is assigned the same reference sign and is not describedagain. The foreign object inspection device 101 is identical inconfiguration to the foreign object inspection device 100 except thatthe foreign object inspection device 101 further includes a movingmechanism 5.

The inspection target 1 can be described as having a thickness between(i) a side surface thereof which side surface corresponds to the sidefrom which an electromagnetic wave 21 enters the inspection target 1(that is, on the side of the electromagnetic wave generating source 2)and (ii) a side surface thereof which side surface corresponds to theside from which the electromagnetic wave 21 exits the inspection target1 (that is, on the side of the image sensor 3). The direction of thethickness corresponds to the “MZ” direction in FIG. 9. The movingmechanism 5 is configured to translate an inspection target 1 in adirection substantially perpendicular to the MZ direction. Specifically,the moving mechanism 5 is configured to move an inspection target 1 in adirection along a plane substantially perpendicular to the MZ directionin such a manner as to cause the inspection target 1 to cross a spacebetween the electromagnetic wave generating source 2 and the imagesensor 3. The direction parallel to the direction in which the movingmechanism 5 moves an inspection target 1 corresponds to the “MY”direction in FIG. 9.

The image sensor 3 is a time delay integration (TDI) sensor. The foreignobject inspection device 101, in which the image sensor 3 is a TDIsensor, detects a foreign object 13 attached to the inspection target 1as described below.

The foreign object inspection device 101 first causes the movingmechanism 5 to translate an inspection target as described above whileemitting an electromagnetic wave 21 toward the inspection target 1 beingtranslated by the moving mechanism 5. The electromagnetic wave 21 havingpropagated through the inspection target 1 is received by a plurality ofpixels 32 of the image sensor 3. The plurality of pixels 32 then form animage on the basis of the electromagnetic wave 21. This image is used todetect a foreign object 13. The plurality of pixels 32 form an image onthe basis of an electromagnetic wave 21 at each of a plurality of timepoints. This allows an image of the same portion of the inspectiontarget 1 to be formed by each inspection stage. The inspection stageseach include multiple pixels 32 arranged next to one another in thecolumn direction in FIG. 3. The plurality of time points, stateddifferently, indicate a plurality of states of the inspection target 1being positioned differently. The foreign object inspection device 101superimposes images of the same portion of the inspection target 1(which have been formed by the respective inspection stages) to producean image in which a foreign object 13 has been made apparent, andthereby detects the foreign object 13.

The foreign object inspection device 101 is capable of, duringinspection carried out while an inspection target 1 having a thicknessis being moved, (i) carrying out the inspection more efficiently bypreventing the inspection capability from decreasing due to an imageblur and (ii) reducing the risk of a failure to detect a foreign object.

FIG. 10 is a diagram schematically illustrating the configuration of aforeign object inspection device 102 as a second variation of theforeign object inspection device 100 illustrated in FIG. 1. FIG. 11 is adiagram illustrating how a rotating mechanism 6 rotates an inspectiontarget 1. The foreign object inspection device 102 is identical inconfiguration to the foreign object inspection device 100 except thatthe foreign object inspection device 102 further includes a rotatingmechanism 6.

The rotating mechanism 6 is configured to rotate an inspection target 1about an axis 15 that extends in the MZ direction, that is, from theside from which an electromagnetic wave 21 enters the inspection target1 to the side from which the electromagnetic wave 21 exits theinspection target 1. As illustrated in FIG. 11, the axis 15 is a centralaxis for the inspection target 1.

The image sensor 3 is a TDI sensor. The foreign object inspection device102, in which the image sensor 3 is a TDI sensor, detects a foreignobject 13 attached to the inspection target 1 as described below.

The foreign object inspection device 102 first causes the rotatingmechanism 6 to rotate an inspection target 1 as described above whileemitting an electromagnetic wave 21 toward the inspection target 1 beingrotated by the rotating mechanism 6. The electromagnetic wave 21 havingpropagated through the inspection target 1 is received by a plurality ofpixels 32 of the image sensor 3. The foreign object inspection device102 then performs an operation similar to that performed by the foreignobject inspection device 101 to detect a foreign object 13.

Inspecting an inspection target 1 while translating or rotating theinspection target 1 is highly efficient. An inspection carried out whilean inspection target 1 having a thickness is being translated or rotatedinvolves an issue of a blur on that portion of an image whichcorresponds to a foreign object 13. Specifically, in a case where a TDIsensor as the image sensor 3 is used to detect a foreign object 13 on aninspection target 1 through any of the above procedures, an image formedby an inspection stage may show a foreign object 13 that is blurred inthe MY direction. This tendency is noticeable particularly in a casewhere the inspection target 1 has a fairly large thickness.

The foreign object inspection devices 101 and 102, each of whichincludes the image processing device 4 (in particular, the pixel valueintegrating section 44), are each capable of, on the basis of aprinciple similar to that for the foreign object inspection device 100,reducing the risk of a failure to detect a foreign object 13. Theforeign object inspection devices 101 and 102 are also each capable ofshortening the exposure time period for image capturing as compared toconventional art, similarly to the foreign object inspection device 100.

The description below deals with how the effectiveness of the pixelvalue integrating section 44 of the foreign object inspection device 100(which uses an X ray as an electromagnetic wave 21) has been verified.FIG. 12 is a table that shows the results of the verification.

First, an image of an inspection target 1 with a foreign object 13 wascaptured four times (“FOREIGN-OBJECT IMAGE 1” to “FOREIGN-OBJECT IMAGE4” in FIG. 12). Further, an image of an inspection target 1 without aforeign object 13 was captured 13 times (“NO-FOREIGN-OBJECT IMAGE 1” to“NO-FOREIGN-OBJECT IMAGE 13” in FIG. 12).

For each of the above images, the density level of a target pixel 33 wasdetermined through each of the approaches 1 to 7 defined below. For theapproaches 3 to 7 among the approaches below, the integrated value ofthe individual second pixel values is used at the stage at which theaverage of the second pixel values is calculated.

Approach 1: Select, as a density level, the third smallest value amongthe respective second pixel values of nine pixels 32 arranged in a 3×3matrix with the target pixel 33 as the center.

Approach 2: Select, as a density level, the average of the smallestvalue, the second smallest value, and the third smallest value among therespective second pixel values of nine pixels 32 arranged in a 3×3matrix with the target pixel 33 as the center.

Approach 3: Select, as a density level, the average of the respectivesecond pixel values of nine pixels 32 arranged in a 3×3 matrix with thetarget pixel 33 as the center.

Approach 4: Select, as a density level, the average of the respectivesecond pixel values of 16 pixels 32 arranged in a 4×4 matrix with thetarget pixel 33 as the center.

Approach 5: Select, as a density level, the average of the respectivesecond pixel values of 25 pixels 32 arranged in a 5×5 matrix with thetarget pixel 33 as the center.

Approach 6: Select, as a density level, the average of values obtainedby assigning, in accordance with a predetermined normal distribution,respective weights to the respective second pixel values of 25 pixels 32arranged in a 5×5 matrix with the target pixel 33 as the center.

Approach 7: Select, as a density level, the average of values obtainedby assigning, in accordance with a normal distribution different fromthat for the approach 6 (specifically, with a different Gaussian-weightvariance for use in assigning weights), respective weights to therespective second pixel values of 25 pixels 32 arranged in a 5×5 matrixwith the target pixel 33 as the center.

For each of the approaches 1 to 7, a worst S, a worst N, and a worstS/worst N ratio defined below were determined.

Worst S: That one of the respective density levels of “FOREIGN-OBJECTIMAGE 1” to “FOREIGN-OBJECT IMAGE 4” which is the closest to 0%

Worst N: That one of the respective density levels of “NO-FOREIGN-OBJECTIMAGE 1” to “NO-FOREIGN-OBJECT IMAGE 13” which is the farthest from 0%

Worst S/worst N ratio: The ratio of the worst S to the worst N

A worst S/worst N ratio of greater than 1 indicates that the“FOREIGN-OBJECT IMAGE 1” to “FOREIGN-OBJECT IMAGE 4” and“NO-FOREIGN-OBJECT IMAGE 1” to “NO-FOREIGN-OBJECT IMAGE 13” arediscriminated from one another appropriately, and thus shows asufficient prevention of a failure to detect a foreign object 13 in astate where there is no false detection (that is, an event of, even in acase where there is no foreign object 13, determining that a foreignobject 13 has been detected). Further, a larger worst S/worst N ratioindicates that the above discrimination is clearer, and can thus beregarded as showing a larger effect of preventing a failure to detect aforeign object 13 in a state where there is no false detection.

FIG. 12 shows that the approaches 3 to 7 each have a worst S/worst Nratio of greater than 1, indicating a sufficient prevention of a failureto detect a foreign object 13 in a state where there is no falsedetection. FIG. 12 shows that the approaches 1 and 2 each have a worstS/worst N ratio of smaller than 1, indicating an insufficient preventionof a failure to detect a foreign object 13 in a state where there is nofalse detection. The worst S/worst N ratio is larger for the approach 4than for the approach 3, and is larger for the approach 5 than for theapproach 4. Stated differently, the worst S/worst N ratio is larger as alarger number of pixels 32 are used to integrate second pixel values.This indicates that a larger number of pixels of which the respectivesecond pixel values are integrated means a larger effect of preventing afailure to detect a foreign object 13 in a state where there is no falsedetection.

The above results prove that integrating the respective second pixelvalues of a group of pixels belonging in a continuous region including atarget pixel 33 increases the effect of preventing a failure to detect aforeign object 13 in a state where there is no false detection. Theabove results thereby verify the effectiveness of the pixel valueintegrating section 44 of the foreign object inspection device 100.

[Recap]

An image processing device in accordance with an embodiment of thepresent invention is an image processing device for processing an imagecaptured of (i) an inspection target as a background in an inspectionimage and (ii) a foreign object having contrast to the background, theimage processing device including: a storage section configured to storerespective first pixel values of a plurality of pixels that form theimage; a pixel value computing section configured to select each of theplurality of pixels as a target pixel and calculate a second pixel valueof the target pixel, the second pixel value being (i) a differencebetween a first pixel value of the target pixel and a background valueof the target pixel or (ii) a ratio of the difference to the backgroundvalue; and a background value setting section configured to, for eachtarget pixel, (i) obtain a value for use as the background value on abasis of a first pixel value of at least one reference pixel present ina vicinity of the target pixel and having a predetermined positionalrelationship with the target pixel and (ii) set the background value ofthe target pixel to the value obtained.

An image processing method in accordance with an embodiment of thepresent invention is an image processing method for processing an imagecaptured of (i) an inspection target as a background in an inspectionimage and (ii) a foreign object having contrast to the background, theimage processing method including: a storage step of storing respectivefirst pixel values of a plurality of pixels that form the image; a pixelvalue computing step of selecting each of the plurality of pixels as atarget pixel and calculating a second pixel value of the target pixel,the second pixel value being (i) a difference between a first pixelvalue of the target pixel and a background value of the target pixel or(ii) a ratio of the difference to the background value; and a backgroundvalue setting step of, for each target pixel, (i) obtaining a value foruse as the background value on a basis of a first pixel value of atleast one reference pixel present in a vicinity of the target pixel andhaving a predetermined positional relationship with the target pixel and(ii) setting the background value of the target pixel to the valueobtained.

The above configuration allows a background value to be set on the basisof the respective first pixel values of reference pixels present in thevicinity of the target pixel. In a case where, for instance,radiographic inspection involves detecting (i) an inspection targethaving a somewhat varying, but relatively high transmittance and (ii) aforeign object attached to the inspection target and having a relativelylow transmittance, the above configuration allows a second pixel valueto be calculated which second pixel value is influenced less by thetransmittance variation. Referring to the second pixel value indetecting a foreign object allows high-accuracy foreign objectinspection.

The above configuration, in other words, allows the distribution oftransmittance of an inspection target to be canceled out. For instance,even in a case where an inspection target has a transmittance thatvaries (or is distributed) according to the position on the inspectiontarget, and the variation cannot be represented with straight contourlines, the contour lines each having a low curvature allows a backgroundvalue to be set mostly accurately (that is, with only a slight error).This in turn allows the correct second pixel value to be calculated.

An image processing device and image processing method both inaccordance with an embodiment of the present invention are each arrangedsuch that the at least one reference pixel includes a plurality ofreference pixels.

The above configuration allows a larger number of first pixel values tobe referred to in finding a value for use as a background value, andthereby allows a background value to be set by any of a wider range ofmethods.

An image processing device and image processing method both inaccordance with an embodiment of the present invention are each arrangedsuch that the plurality of reference pixels include pixels present insuch a pattern as to surround the target pixel corresponding to theplurality of reference pixels.

In a case where a reference pixel(s) and another pixel(s) present in thevicinity of the reference pixel(s) are each an unsuitable pixel having afirst pixel value that is not suited as a value for use in setting abackground value, the above configuration can reduce the proportion ofunsuitable pixels among the plurality of reference pixels. This makes itpossible to reduce the risk of the first pixel value of an unsuitablepixel adversely affecting how a background value is set.

An image processing device and image processing method both inaccordance with an embodiment of the present invention are each arrangedsuch that the plurality of reference pixels include pixels presentsymmetrically in a row direction and a column direction relative to thetarget pixel corresponding to the plurality of reference pixels.

Regardless of the direction in which unsuitable pixels are presentlocally relative to the target pixel, the above configuration can reducethe proportion of unsuitable pixels among the plurality of referencepixels to an extent. This makes it possible to reduce the risk of thefirst pixel value of an unsuitable pixel adversely affecting how abackground value is set.

An image processing device and image processing method both inaccordance with an embodiment of the present invention are each arrangedsuch that the plurality of reference pixels include pixels present inn-fold symmetry (where n is an integer of 2 or greater) relative to, asa center, the target pixel corresponding to the plurality of referencepixels.

Regardless of the direction in which unsuitable pixels are presentlocally relative to the target pixel, the above configuration can reducethe proportion of unsuitable pixels among the plurality of referencepixels. This makes it possible to sufficiently reduce the risk of thefirst pixel value of an unsuitable pixel adversely affecting how abackground value is set.

An image processing device in accordance with an embodiment of thepresent invention is arranged such that the background value settingsection sets the background value to (i) a median value among respectivefirst pixel values of the plurality of reference pixels or (ii) a valueranked in a predetermined place among the respective first pixel valuesof the plurality of reference pixels except for a maximum value and aminimum value.

An image processing method in accordance with an embodiment of thepresent invention is arranged such that the background value settingstep includes setting the background value to (i) a median value amongrespective first pixel values of the plurality of reference pixels or(ii) a value ranked in a predetermined place among the respective firstpixel values of the plurality of reference pixels except for a maximumvalue and a minimum value.

The above configuration makes it easy to prevent the background valuefrom being set to an extremely large or extremely small value among therespective first pixel values of the plurality of reference pixels. Theabove configuration also makes it easy to prevent the background valuefrom being much larger or much smaller than an appropriate backgroundvalue due to the above inappropriateness. The above configurationthereby makes it possible to set a background value more suitable for animage captured.

A foreign object inspection device in accordance with an embodiment ofthe present invention includes: an X-ray image sensor; and the imageprocessing device, the storage section storing, as the first pixelvalues, pixel values of an image obtained by the X-ray image sensor.

A foreign object inspection method in accordance with an embodiment ofthe present invention includes: the image processing method, the storagestep including storing, as the first pixel values, pixel values of animage obtained by an X-ray image sensor.

With the above configuration, the foreign object inspection device andthe foreign object inspection method produce effects similarly to thoseproduced by the image processing device and the image processing method.

The present invention is not limited to the embodiments, but can bealtered by a skilled person in the art within the scope of the claims.The present invention also encompasses, in its technical scope, anyembodiment derived by combining technical means disclosed in differingembodiments.

REFERENCE SIGNS LIST

-   -   1 Inspection target    -   11 Core    -   12 Nonaqueous electrolyte secondary battery separator    -   13 Foreign object    -   14 Tape or label    -   15 Axis    -   2 Electromagnetic wave generating source    -   21 Electromagnetic wave    -   22 Center of a portion at which an electromagnetic wave is        generated    -   23 Quadrangular pyramid    -   3 Image sensor    -   31 Principal surface    -   32 Pixel    -   33 Target pixel    -   34 Reference pixel    -   35 Unsuitable pixel    -   36 to 38 Pixel group    -   4 Image processing device    -   41 Storage section    -   42 Pixel value computing section    -   43 Background value setting section    -   44 Pixel value integrating section    -   5 Moving mechanism    -   6 Rotating mechanism    -   100, 101, 102 Foreign object inspection device

1. An image processing device for processing an image captured of (i) aninspection target as a background in an inspection image and (ii) aforeign object having contrast to the background, the image processingdevice comprising: a storage section configured to store respectivefirst pixel values of a plurality of pixels that form the image; a pixelvalue computing section configured to select each of the plurality ofpixels as a target pixel and calculate a second pixel value of thetarget pixel, the second pixel value being (i) a difference between afirst pixel value of the target pixel and a background value of thetarget pixel or (ii) a ratio of the difference to the background value;and a background value setting section configured to, for each targetpixel, (i) obtain a value for use as the background value on a basis ofa first pixel value of at least one reference pixel present in avicinity of the target pixel and having a predetermined positionalrelationship with the target pixel and (ii) set the background value ofthe target pixel to the value obtained.
 2. The image processing deviceaccording to claim 1, wherein the at least one reference pixel includesa plurality of reference pixels.
 3. The image processing deviceaccording to claim 2, wherein the plurality of reference pixels includepixels present in such a pattern as to surround the target pixelcorresponding to the plurality of reference pixels.
 4. The imageprocessing device according to claim 2, wherein the plurality ofreference pixels include pixels present symmetrically in a row directionand a column direction relative to the target pixel corresponding to theplurality of reference pixels.
 5. The image processing device accordingto claim 2, wherein the plurality of reference pixels include pixelspresent in n-fold symmetry (where n is an integer of 2 or greater)relative to, as a center, the target pixel corresponding to theplurality of reference pixels.
 6. The image processing device accordingto claim 2, wherein the background value setting section sets thebackground value to (i) a median value among respective first pixelvalues of the plurality of reference pixels or (ii) a value ranked in apredetermined place among the respective first pixel values of theplurality of reference pixels except for a maximum value and a minimumvalue.
 7. A foreign object inspection device, comprising: an X-ray imagesensor; and an image processing device according to claim 1, the storagesection storing, as the first pixel values, pixel values of an imageobtained by the X-ray image sensor.
 8. An image processing method forprocessing an image captured of (i) an inspection target as a backgroundin an inspection image and (ii) a foreign object having contrast to thebackground, the image processing method comprising: a storage step ofstoring respective first pixel values of a plurality of pixels that formthe image; a pixel value computing step of selecting each of theplurality of pixels as a target pixel and calculating a second pixelvalue of the target pixel, the second pixel value being (i) a differencebetween a first pixel value of the target pixel and a background valueof the target pixel or (ii) a ratio of the difference to the backgroundvalue; and a background value setting step of, for each target pixel,(i) obtaining a value for use as the background value on a basis of afirst pixel value of at least one reference pixel present in a vicinityof the target pixel and having a predetermined positional relationshipwith the target pixel and (ii) setting the background value of thetarget pixel to the value obtained.
 9. The image processing methodaccording to claim 8, wherein the at least one reference pixel includesa plurality of reference pixels.
 10. The image processing methodaccording to claim 9, wherein the plurality of reference pixels includepixels present in such a pattern as to surround the target pixelcorresponding to the plurality of reference pixels.
 11. The imageprocessing method according to claim 9, wherein the plurality ofreference pixels include pixels present symmetrically in a row directionand a column direction relative to the target pixel corresponding to theplurality of reference pixels.
 12. The image processing method accordingto claim 9, wherein the plurality of reference pixels include pixelspresent in n-fold symmetry (where n is an integer of 2 or greater)relative to, as a center, the target pixel corresponding to theplurality of reference pixels.
 13. The image processing method accordingto claim 9, wherein the background value setting step includes settingthe background value to (i) a median value among respective first pixelvalues of the plurality of reference pixels or (ii) a value ranked in apredetermined place among the respective first pixel values of theplurality of reference pixels except for a maximum value and a minimumvalue.
 14. A foreign object inspection method, comprising: an imageprocessing method according to claim 8, the storage step includingstoring, as the first pixel values, pixel values of an image obtained byan X-ray image sensor.